#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
using ll = long long;
const int inf = 0x3f3f3f3f;
#define rf(i, n) for (int i = 1; i <= (n); ++i)
int rad();  // read int
const int max_size = 5 + 100;
const int maxn = 5 + 2e4;

struct Node {
    int dat[maxn << 1];
    int len;
    void read() {
        string str;
        cin >> str;
        init(str);
    }

    void init(string &str) {
        memset(dat, 0, sizeof(dat));
        len = str.size();
        for (int i = 0, j = len - 1; i < len; ++i, --j) {
            dat[i] = str[j] - '0';
        }
    }

    void show() {
        int now = len;
        while (now >= 0 && dat[now] == 0)
            --now;
        if (now == -1) cout << 0;
        while (now >= 0)
            cout << dat[now--];
    }
};

Node a, b, c;
int div(Node &c, Node &a, int b) {
    memset(c.dat, 0, sizeof(c.dat));
    c.len = a.len;
    ll tmp = 0;
    for (int i = a.len; i >= 0; --i) {
        tmp = tmp * 10 + a.dat[i];
        c.dat[i] = tmp / b;
        tmp %= b;
    }
    return tmp % b;
}

void add(Node &c, Node &a) {  // c += a
    c.len = max(c.len, a.len);
    for (int i = 0; i <= c.len; ++i) {
        c.dat[i] += a.dat[i];
        if (c.dat[i] >= 10) {
            c.dat[i] -= 10;
            c.dat[i + 1]++;
        }
    }
    if (c.dat[c.len] != 0) c.len++;
}

void mult(Node &c, Node &a, Node &b) {  // c = a * b
    memset(c.dat, 0, sizeof(c.dat));
    c.len = a.len + b.len;
    for (int i = 0; i < a.len; ++i) {
        for (int j = 0; j < b.len; ++j) {
            c.dat[i + j] += a.dat[i] * b.dat[j];
            if (c.dat[i + j] >= 10) {
                c.dat[i + j + 1] += c.dat[i + j] / 10;
                c.dat[i + j] %= 10;
            }
        }
    }
    if (c.dat[c.len] != 0) c.len++;
}

void sub(Node &c, Node &a, Node &b) {  // c = a - b, a >= b
    c.len = max(a.len, b.len);
    for (int i = 0; i <= c.len; ++i) {
        c.dat[i] += a.dat[i] - b.dat[i];
        if (c.dat[i] < 0) {
            c.dat[i + 1]--;
            c.dat[i] += 10;
        }
    }
}

int n;
int main() {
    string as, bs;
    cin >> as >> bs;
    if (as.size() < bs.size() || as.size() == bs.size() && as < bs) {
        cout << '-';
        a.init(bs);
        b.init(as);
    } else {
        a.init(as);
        b.init(bs);
    }
    sub(c, a, b);
    c.show();
}

int rad() {
    int back = 0, ch = 0, neg = 0;
    for (; ch < '0' || ch > '9'; ch = getchar())
        neg = ch == '-';
    for (; ch >= '0' && ch <= '9'; ch = getchar())
        back = (back << 1) + (back << 3) + (ch & 0xf);
    return (back ^ -neg) + neg;
}